<html>
<head><meta charset="utf-8"><title>elided lifetime parameter names and async handling? · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/elided.20lifetime.20parameter.20names.20and.20async.20handling.3F.html">elided lifetime parameter names and async handling?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="173822534"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/elided%20lifetime%20parameter%20names%20and%20async%20handling%3F/near/173822534" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/elided.20lifetime.20parameter.20names.20and.20async.20handling.3F.html#173822534">(Aug 21 2019 at 18:58)</a>:</h4>
<p>Hi <span class="user-mention" data-user-id="116009">@nikomatsakis</span> </p>
<p>I'm having a bit of trouble in <a href="https://github.com/rust-lang/rust/pull/58281" target="_blank" title="https://github.com/rust-lang/rust/pull/58281">https://github.com/rust-lang/rust/pull/58281</a>. It seems that for some async fns, elided lifetimes produce regions that are actually called <code>'_</code> now? To the best of my understanding, this is due to the changes in <a href="https://github.com/rust-lang/rust/pull/63501" target="_blank" title="https://github.com/rust-lang/rust/pull/63501">https://github.com/rust-lang/rust/pull/63501</a></p>
<p>The problem is that now, we don't properly generate a new lifetime for emitting diagnostics, so with my changes, we now have error messages like </p>
<div class="codehilite"><pre><span></span>help: consider adding the following bound: `&#39;_: &#39;_`
</pre></div>


<p>Based on my limited understanding, it seems like sometimes, we should be generating <code>ParamName::Fresh</code> rather than <code>ParamName::Plain</code> when we lower <code>async fn</code>s. Any thoughts?</p>



<a name="174106198"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/elided%20lifetime%20parameter%20names%20and%20async%20handling%3F/near/174106198" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/elided.20lifetime.20parameter.20names.20and.20async.20handling.3F.html#174106198">(Aug 26 2019 at 00:27)</a>:</h4>
<p>not sure if <span class="user-mention" data-user-id="116118">@Matthew Jasper</span> or <span class="user-mention" data-user-id="116083">@pnkfelix</span> would be able to help too...</p>



<a name="174465574"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/elided%20lifetime%20parameter%20names%20and%20async%20handling%3F/near/174465574" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/elided.20lifetime.20parameter.20names.20and.20async.20handling.3F.html#174465574">(Aug 29 2019 at 15:36)</a>:</h4>
<p><span class="user-mention" data-user-id="198054">@mark-i-m</span> hmm</p>



<a name="174465584"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/elided%20lifetime%20parameter%20names%20and%20async%20handling%3F/near/174465584" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/elided.20lifetime.20parameter.20names.20and.20async.20handling.3F.html#174465584">(Aug 29 2019 at 15:36)</a>:</h4>
<p>I think I made some changes in this regard, actually</p>



<a name="174465636"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/elided%20lifetime%20parameter%20names%20and%20async%20handling%3F/near/174465636" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/elided.20lifetime.20parameter.20names.20and.20async.20handling.3F.html#174465636">(Aug 29 2019 at 15:37)</a>:</h4>
<p>In particular, using <code>ParamName::Fresh</code> to generate elided lifetimes</p>



<a name="174465707"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/elided%20lifetime%20parameter%20names%20and%20async%20handling%3F/near/174465707" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/elided.20lifetime.20parameter.20names.20and.20async.20handling.3F.html#174465707">(Aug 29 2019 at 15:38)</a>:</h4>
<p>That said: the problem of "anonymous lifetimes" is one of the reasons the NLL errors were introducing names for lifetimes and things, right? I guess I'd have to read a bit more into the code. But in the meantime, I'd say, try rebasing and see if things are any better? If not, ping me again and we can dig a bit more in :)</p>



<a name="174482222"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/elided%20lifetime%20parameter%20names%20and%20async%20handling%3F/near/174482222" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/elided.20lifetime.20parameter.20names.20and.20async.20handling.3F.html#174482222">(Aug 29 2019 at 18:57)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> I rebased, but am still getting the same <code>'_</code> lifetimes.</p>



<a name="174482303"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/elided%20lifetime%20parameter%20names%20and%20async%20handling%3F/near/174482303" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/elided.20lifetime.20parameter.20names.20and.20async.20handling.3F.html#174482303">(Aug 29 2019 at 18:58)</a>:</h4>
<blockquote>
<p>the problem of "anonymous lifetimes" is one of the reasons the NLL errors were introducing names for lifetimes and things, right?</p>
</blockquote>
<p>yes, that's my understanding, which is why I think somewhere we have a bug that fails to recognize anon lifetimes...</p>



<a name="174915700"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/elided%20lifetime%20parameter%20names%20and%20async%20handling%3F/near/174915700" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/elided.20lifetime.20parameter.20names.20and.20async.20handling.3F.html#174915700">(Sep 04 2019 at 19:41)</a>:</h4>
<p>Oh, I was confusing this and <a href="https://github.com/rust-lang/rust/pull/63678/" target="_blank" title="https://github.com/rust-lang/rust/pull/63678/">https://github.com/rust-lang/rust/pull/63678/</a></p>



<a name="175388082"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/elided%20lifetime%20parameter%20names%20and%20async%20handling%3F/near/175388082" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/elided.20lifetime.20parameter.20names.20and.20async.20handling.3F.html#175388082">(Sep 10 2019 at 23:30)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> Do you have any tips on how to debug the source of the lifetime names? I would rather not read the entire <code>librustc_mir</code> looking for them :P</p>



<a name="175532117"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/elided%20lifetime%20parameter%20names%20and%20async%20handling%3F/near/175532117" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/elided.20lifetime.20parameter.20names.20and.20async.20handling.3F.html#175532117">(Sep 12 2019 at 14:04)</a>:</h4>
<p><span class="user-mention" data-user-id="198054">@mark-i-m</span> yeah, sorry, let me schedule some time to look into this. i've added an hour tomorrow, though I might bump it up to today. In the meantime I'll get a build going. I'll post you a response after that!</p>



<a name="175556480"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/elided%20lifetime%20parameter%20names%20and%20async%20handling%3F/near/175556480" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/elided.20lifetime.20parameter.20names.20and.20async.20handling.3F.html#175556480">(Sep 12 2019 at 18:24)</a>:</h4>
<p>btw, it looks like this only happens in async tests, so perhaps it is related to inferred member lifetimes?</p>



<a name="175657342"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/elided%20lifetime%20parameter%20names%20and%20async%20handling%3F/near/175657342" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/elided.20lifetime.20parameter.20names.20and.20async.20handling.3F.html#175657342">(Sep 13 2019 at 19:37)</a>:</h4>
<p><span class="user-mention" data-user-id="198054">@mark-i-m</span> what's an example test where this occurs?</p>



<a name="175657421"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/elided%20lifetime%20parameter%20names%20and%20async%20handling%3F/near/175657421" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/elided.20lifetime.20parameter.20names.20and.20async.20handling.3F.html#175657421">(Sep 13 2019 at 19:38)</a>:</h4>
<p>I guess async-await/issues/issue-63388-1.rs</p>



<a name="175664176"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/elided%20lifetime%20parameter%20names%20and%20async%20handling%3F/near/175664176" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/elided.20lifetime.20parameter.20names.20and.20async.20handling.3F.html#175664176">(Sep 13 2019 at 21:05)</a>:</h4>
<p>Sorry I'm not at my computer atm, but the nll compare mode tests on m branch do this</p>



<a name="175667944"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/elided%20lifetime%20parameter%20names%20and%20async%20handling%3F/near/175667944" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/elided.20lifetime.20parameter.20names.20and.20async.20handling.3F.html#175667944">(Sep 13 2019 at 22:04)</a>:</h4>
<p>Here is the full list of tests:</p>



<a name="175667950"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/elided%20lifetime%20parameter%20names%20and%20async%20handling%3F/near/175667950" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/elided.20lifetime.20parameter.20names.20and.20async.20handling.3F.html#175667950">(Sep 13 2019 at 22:04)</a>:</h4>
<div class="codehilite"><pre><span></span>$ git status
On branch synthesis
Your branch is up to date with &#39;origin/synthesis&#39;.

Changes not staged for commit:
  (use &quot;git add &lt;file&gt;...&quot; to update what will be committed)
  (use &quot;git checkout -- &lt;file&gt;...&quot; to discard changes in working directory)

    modified:   src/test/ui/async-await/issues/issue-63388-1.nll.stderr
    modified:   src/test/ui/c-variadic/variadic-ffi-4.nll.stderr
    modified:   src/test/ui/self/arbitrary_self_types_pin_lifetime_impl_trait-async.nll.stderr
    modified:   src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch-async.nll.stderr
    modified:   src/test/ui/self/elision/lt-ref-self-async.nll.stderr
    modified:   src/test/ui/self/elision/ref-mut-self-async.nll.stderr
    modified:   src/test/ui/self/elision/ref-mut-struct-async.nll.stderr
    modified:   src/test/ui/self/elision/ref-self-async.nll.stderr
    modified:   src/test/ui/self/elision/ref-struct-async.nll.stderr
</pre></div>



<a name="177246304"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/elided%20lifetime%20parameter%20names%20and%20async%20handling%3F/near/177246304" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/elided.20lifetime.20parameter.20names.20and.20async.20handling.3F.html#177246304">(Oct 03 2019 at 13:55)</a>:</h4>
<p>Hi <span class="user-mention" data-user-id="116009">@nikomatsakis</span> do you have any suggestions on how to debug this</p>



<a name="177246333"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/elided%20lifetime%20parameter%20names%20and%20async%20handling%3F/near/177246333" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/elided.20lifetime.20parameter.20names.20and.20async.20handling.3F.html#177246333">(Oct 03 2019 at 13:55)</a>:</h4>
<p>I'm particular i want to trace the origins of a region name</p>



<a name="181328140"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/elided%20lifetime%20parameter%20names%20and%20async%20handling%3F/near/181328140" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/elided.20lifetime.20parameter.20names.20and.20async.20handling.3F.html#181328140">(Nov 21 2019 at 17:39)</a>:</h4>
<p>Some more updates here</p>



<a name="181328385"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/elided%20lifetime%20parameter%20names%20and%20async%20handling%3F/near/181328385" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/elided.20lifetime.20parameter.20names.20and.20async.20handling.3F.html#181328385">(Nov 21 2019 at 17:42)</a>:</h4>
<p>It looks like the regions with name <code>'_</code> are considered <code>NamedFreeRegions</code> by the code in <code>region_name.rs</code>. I suspect that this is coming from <code>ty::ReFree</code> in <code>give_name_from_error_region</code>, and will keep tracing it back...</p>



<a name="181576691"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/elided%20lifetime%20parameter%20names%20and%20async%20handling%3F/near/181576691" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/elided.20lifetime.20parameter.20names.20and.20async.20handling.3F.html#181576691">(Nov 21 2019 at 19:40)</a>:</h4>
<p>Specifically, it is coming from a  <code>ty::BoundRegion::BrNamed</code> where the name is <code>_</code></p>



<a name="181576882"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/elided%20lifetime%20parameter%20names%20and%20async%20handling%3F/near/181576882" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/elided.20lifetime.20parameter.20names.20and.20async.20handling.3F.html#181576882">(Nov 21 2019 at 19:42)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> Any thoughts on where to go from here? It seems like there are a billion places a <code>BrNamed</code> could be coming from...</p>



<a name="181576913"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/elided%20lifetime%20parameter%20names%20and%20async%20handling%3F/near/181576913" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/elided.20lifetime.20parameter.20names.20and.20async.20handling.3F.html#181576913">(Nov 21 2019 at 19:42)</a>:</h4>
<p>Do you know which one is mostly to be caused by an implicit lifetime on an <code>async</code> function return type?</p>



<a name="181577144"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/elided%20lifetime%20parameter%20names%20and%20async%20handling%3F/near/181577144" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/elided.20lifetime.20parameter.20names.20and.20async.20handling.3F.html#181577144">(Nov 21 2019 at 19:45)</a>:</h4>
<p>Or alternately, perhaps a call to <code>EarlyBoundRegion::has_name</code> was missed somewhere when converting to a <code>BoundRegion</code>?</p>



<a name="181578798"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/elided%20lifetime%20parameter%20names%20and%20async%20handling%3F/near/181578798" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/elided.20lifetime.20parameter.20names.20and.20async.20handling.3F.html#181578798">(Nov 21 2019 at 20:02)</a>:</h4>
<p>Hmm... possibly this is the culprit:</p>



<a name="181578799"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/elided%20lifetime%20parameter%20names%20and%20async%20handling%3F/near/181578799" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/elided.20lifetime.20parameter.20names.20and.20async.20handling.3F.html#181578799">(Nov 21 2019 at 20:02)</a>:</h4>
<div class="codehilite"><pre><span></span>[DEBUG rustc_mir::borrow_check::nll::universal_regions] defining_ty (pre-replacement): for&lt;&#39;a, &#39;_&gt; fn(&amp;&#39;a Xyz, &amp;dyn Foo) -&gt; impl std::future::Future {Xyz::do_sth}
</pre></div>



<a name="181578890"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/elided%20lifetime%20parameter%20names%20and%20async%20handling%3F/near/181578890" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/elided.20lifetime.20parameter.20names.20and.20async.20handling.3F.html#181578890">(Nov 21 2019 at 20:03)</a>:</h4>
<p>It seems that the <code>'_</code> is created as a <code>BrNamed</code> rather <code>BrAnon</code> at some point... Or am I misunderstanding?</p>



<a name="181579073"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/elided%20lifetime%20parameter%20names%20and%20async%20handling%3F/near/181579073" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/elided.20lifetime.20parameter.20names.20and.20async.20handling.3F.html#181579073">(Nov 21 2019 at 20:05)</a>:</h4>
<p>You should be able to see that with <code>-Zverbose</code>. But that sounds correct.</p>



<a name="181579253"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/elided%20lifetime%20parameter%20names%20and%20async%20handling%3F/near/181579253" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/elided.20lifetime.20parameter.20names.20and.20async.20handling.3F.html#181579253">(Nov 21 2019 at 20:08)</a>:</h4>
<p><span class="user-mention" data-user-id="116118">@Matthew Jasper</span> where would I see it? Would it be before MIR creation?</p>



<a name="181579327"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/elided%20lifetime%20parameter%20names%20and%20async%20handling%3F/near/181579327" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/elided.20lifetime.20parameter.20names.20and.20async.20handling.3F.html#181579327">(Nov 21 2019 at 20:08)</a>:</h4>
<p>I meant see the variant name in the logs.</p>



<a name="181579352"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/elided%20lifetime%20parameter%20names%20and%20async%20handling%3F/near/181579352" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/elided.20lifetime.20parameter.20names.20and.20async.20handling.3F.html#181579352">(Nov 21 2019 at 20:08)</a>:</h4>
<p>Oh yes, it is BrNamed</p>



<a name="181579384"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/elided%20lifetime%20parameter%20names%20and%20async%20handling%3F/near/181579384" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/elided.20lifetime.20parameter.20names.20and.20async.20handling.3F.html#181579384">(Nov 21 2019 at 20:09)</a>:</h4>
<p>I guess my question is should it be BrAnon? And where would that be constructed in the first place?</p>



<a name="181579533"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/elided%20lifetime%20parameter%20names%20and%20async%20handling%3F/near/181579533" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/elided.20lifetime.20parameter.20names.20and.20async.20handling.3F.html#181579533">(Nov 21 2019 at 20:11)</a>:</h4>
<p><span class="user-mention" data-user-id="116118">@Matthew Jasper</span> In particular, I see the following in the logs:</p>
<div class="codehilite"><pre><span></span>[DEBUG rustc::ty::sty] type_flags(ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(15), &#39;_))) = HAS_RE_LATE_BOUND
</pre></div>



<a name="181579556"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/elided%20lifetime%20parameter%20names%20and%20async%20handling%3F/near/181579556" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/elided.20lifetime.20parameter.20names.20and.20async.20handling.3F.html#181579556">(Nov 21 2019 at 20:11)</a>:</h4>
<p>How can I find out where this was created?</p>



<a name="181579682"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/elided%20lifetime%20parameter%20names%20and%20async%20handling%3F/near/181579682" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/elided.20lifetime.20parameter.20names.20and.20async.20handling.3F.html#181579682">(Nov 21 2019 at 20:12)</a>:</h4>
<p>librustc/ty/mod.rs:853</p>



<a name="181579893"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/elided%20lifetime%20parameter%20names%20and%20async%20handling%3F/near/181579893" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/elided.20lifetime.20parameter.20names.20and.20async.20handling.3F.html#181579893">(Nov 21 2019 at 20:15)</a>:</h4>
<p>I don't think that we can create an <code>BrAnon</code> there correctly: I don't think that the index of the <code>EarlyBoundRegion</code> is compatible with the index in <code>BrAnon</code>.</p>



<a name="181580056"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/elided%20lifetime%20parameter%20names%20and%20async%20handling%3F/near/181580056" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/elided.20lifetime.20parameter.20names.20and.20async.20handling.3F.html#181580056">(Nov 21 2019 at 20:17)</a>:</h4>
<p>Hmm... I'm not very knowledgeable about the indexing system... what exactly is the difference?</p>



<a name="181580070"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/elided%20lifetime%20parameter%20names%20and%20async%20handling%3F/near/181580070" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/elided.20lifetime.20parameter.20names.20and.20async.20handling.3F.html#181580070">(Nov 21 2019 at 20:17)</a>:</h4>
<p>Or really why are they different?</p>



<a name="181580184"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/elided%20lifetime%20parameter%20names%20and%20async%20handling%3F/near/181580184" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/elided.20lifetime.20parameter.20names.20and.20async.20handling.3F.html#181580184">(Nov 21 2019 at 20:19)</a>:</h4>
<p>The early bound index is the position in <code>ty::Generics.parms</code>, the late bound index is some unique index for the corresponding <code>Binder</code>.</p>



<a name="181580237"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/elided%20lifetime%20parameter%20names%20and%20async%20handling%3F/near/181580237" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/elided.20lifetime.20parameter.20names.20and.20async.20handling.3F.html#181580237">(Nov 21 2019 at 20:19)</a>:</h4>
<p>Also, do you know where <code>to_bound_region</code> is called from? <code>rg</code> doesn't seem to find anything for some reason...</p>



<a name="181580239"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/elided%20lifetime%20parameter%20names%20and%20async%20handling%3F/near/181580239" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/elided.20lifetime.20parameter.20names.20and.20async.20handling.3F.html#181580239">(Nov 21 2019 at 20:19)</a>:</h4>
<p>Hmm... I see</p>



<a name="181580808"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/elided%20lifetime%20parameter%20names%20and%20async%20handling%3F/near/181580808" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/elided.20lifetime.20parameter.20names.20and.20async.20handling.3F.html#181580808">(Nov 21 2019 at 20:26)</a>:</h4>
<p>Apparently it isn't. It's actually in <code>librustc/middle/resolve_lifetime.rs:96</code>, but the idea's the same.</p>



<a name="181580842"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/elided%20lifetime%20parameter%20names%20and%20async%20handling%3F/near/181580842" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/elided.20lifetime.20parameter.20names.20and.20async.20handling.3F.html#181580842">(Nov 21 2019 at 20:26)</a>:</h4>
<p>The generation of the <code>'_</code>-named region, that is.</p>



<a name="181596122"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/elided%20lifetime%20parameter%20names%20and%20async%20handling%3F/near/181596122" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/elided.20lifetime.20parameter.20names.20and.20async.20handling.3F.html#181596122">(Nov 21 2019 at 23:34)</a>:</h4>
<p>So if I understand correctly, using the BrNamed in this case is the correct thing to do?</p>



<a name="181596167"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/elided%20lifetime%20parameter%20names%20and%20async%20handling%3F/near/181596167" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/elided.20lifetime.20parameter.20names.20and.20async.20handling.3F.html#181596167">(Nov 21 2019 at 23:34)</a>:</h4>
<p>Would the best fix then be to check the name better when finding the name to print in error messages in rustc_mir::borrow_check::nll::region_infer::error_reporting::region_name?</p>



<a name="181596464"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/elided%20lifetime%20parameter%20names%20and%20async%20handling%3F/near/181596464" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/elided.20lifetime.20parameter.20names.20and.20async.20handling.3F.html#181596464">(Nov 21 2019 at 23:39)</a>:</h4>
<p>Checking the name seems fine.</p>



<a name="181597007"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/elided%20lifetime%20parameter%20names%20and%20async%20handling%3F/near/181597007" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/elided.20lifetime.20parameter.20names.20and.20async.20handling.3F.html#181597007">(Nov 21 2019 at 23:48)</a>:</h4>
<p>Ok, thanks for the help... I will play around with this and maybe put up a PR at some point</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>